// web/src/app/(employee)/company-side/[id]/new-employee/page.tsx
import React from 'react';
import {db} from "@/lib/db";
import {currentUser} from "@/lib/auth";
import CreateEmployeeForm from "@/app/(employee)/company-side/new-employee/_components/create-employee-form";

/// 发布职位页面
const Page = async () => {
    const user = await currentUser()
    const hr = await db.hr.findFirst({
        where: {
            userId: user?.id,
        },
        include: {
            company: true
        }
    })
    if (!hr) return <div>当前用户不是公司HR账户</div>

    const cities = await db.city.findMany()
    const educations = await db.education.findMany()

    return (
        <div>
            <CreateEmployeeForm
                hr={hr}
                cities={cities}
                educations={educations}
            />
        </div>
    );
};

export default Page;